package com.woniuxy.store.client;

import com.woniuxy.store.client.param.couponParam.AddCouponParams;
import com.woniuxy.store.client.param.couponParam.ModifyCouponParams;
import com.woniuxy.store.client.param.couponParam.SearchCouponParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import result.Result;

@FeignClient(contextId = "couponsClient",name = "store",path = "/store/marketing")
public interface CouponsClient {
    @PostMapping({"/addCoupon"})
    Result addCoupon(@RequestBody AddCouponParams param);

    @DeleteMapping({"/deleteCoupon"})
    Result deleteCoupon(@RequestParam("couponId") Integer couponId);

    @PostMapping({"/modifyCoupon"})
    Result modifyCoupon(@RequestBody ModifyCouponParams param);

    @PutMapping({"/modifyCouponState"})
    Result modifyCouponState(@RequestParam("couponId") Integer couponId, @RequestParam("couponState") String couponState);

    @GetMapping({"/queryCoupon"})
    Result queryCoupon(@SpringQueryMap SearchCouponParams param);
}
